mci_quadrocopterws_2014_automation_projectfandomcom-20200213-history
MCI Quadrocopter(WS 2014 Automation Project) Wiki
Welcome to the MCI Quadrocopter (WS 2014 Automation Project) Wiki This wiki deals with commissioning and starting up a quadcopter using the microcontroller XMC 4500. It describes the basic steps like assembling, programming and testing. Introduction One new field in automation and aviation is the field of quadcopters. In this field the whole background of automation and flight dynamics are combined. There is done a lot of research right now, because companies like Amazon try to deliver their cargo with these flying vehicles. In the first term of our Masters program we had to configure a quadcopter, which is controlled with a remote control, with just mechanical setup we got from the company INFINEON. The general idea was to implement the whole measurement, control and software part of a quadcopter. We were split up in teams of eight people. The general idea of this project was to train our skills in the electrical, the software and the team ability parts of our study program. Through the different stages of our project, we got an insight in different types of IMU’s, working with brushless motors and the mechanics behind a quadcopter. To attract the whole attention of us to this project, the instruction team invented a big event at the end of this course. In total there were four teams with four different quadcopters. In this event they are attending a flight course similar to the Red Bull Air Race, and the winner will receive a price. With this method, the instruction team really got all our passion. Task In this chapter the task is described in several steps to cover all necessary steps which are desired from the problem to the fragmentation of the task into different parts. Problem and System description The main Problem of this project was to build up a whole quadcopter system, which include the hardware implementation and the design of the controller. Therefore a lot of work was done in preparation concerning the kinematic model which we got in a reader from similar projects. First of all we discussed in a meeting what are the aims and how we can achieve it. We also talked about the realization of the project. We got an idea how does it work and build on that, this is explained in chapter 2.4. After this meeting the mechatronic department provided us with all the necessary stuff which is Software and Hardware. For this intent we require a quadcopterbaseframe. This baseframe was ordered as a kit which include following parts: * 1x Base frame * 4x Brushless DC-drives * 4x propellers * 4x Motor controllers Additionally to the flightframe kit we need a servo. Furthermore we need a power supply which is ensure by a litium ion accumulator with a capacity of 3200 mA and a voltage of 11,1V. The accumulator is depiced in the following figure. Now the parts of the quatrocopter quite finished. To control the whole system we use a microcontroller from the company INFINEON. This microcontroller XMC 4500 is used to process the input signals of the IMU. The XMC microcontroller is depicted in the following figure. The inertial measurement sensor (IMU) from figure has a DOF (degrees of freedom) of 9. This device has therefore 3 accelerometers, 3 gyroscopes and 3 magnetometers (compasses). The reasons therefore are explained later on. To remote now the quatrocopter we need a remote controller which is available from the company spectrum. The used remode controller is shown in the following figure. To receive the signal from the remote controller via the protocol a receiver is necessary. Tasks The tasks are separated in Steps which have been done by small group works of about 1 – 3 participants. Step 1 Split the theory model from chapter 2.4 into different parts. Therefore we had to get an overview how we can handle this problem and translate it from the theoretical into the practical. Step 2 Ordering the whole equipment which is necessary for the preparation and to get the values for further investigations. Step 3 We build up the kinematic model which means the mathematically formulation and implementation into MATLAB with the tool Simulink. Step 4 Hence we had the kinematic model we had to find out the dynamic behavior with by experiment and approximate it with curve interpolation. The next step was to create a controller which works appropriate for the DC-drives. Step 5 Now we were able to test the IMU therefore we had to make the interfaces and the sensor fusion with a Kalman filter. Step 6 The remote control is missing so far, therefore we had to concentrate on the connection between the controller and the receiver. Step 7 Now we are ready for the first tests. Tools / Software For the Programming and the controlling we used different Software programs. Firstly we used MATLAB Simulink to build up a digital kinematic model and tried it. Additionally we used Dave for programming the XMC microcontroller. Fragmatation into different parts The main part of the block diagram is the µ-controller XMC on the board. On part of the input of the µ-controller is the data from the sensor fusion which includes data from the IMU and the GPS modulus. The GPS is add on of the project and not realized in the first step. The interface between the µ-controller and IMU is I²C. In addition the data which is send from the remote control is received from the receiver is also an input of the µ-controller. The µ-controller software includes the flight control which is based on the kinematic model of the quadcopter. The output is the PWM signal for the ESC of the BLDC, this part exists for all 4 BLDC`s. Kinematic model Like you could already have seen one big part of the whole project was the kinematic model. At first it seemed really hard to produce a MATLAB model, but with a lot of reading through different literature, we were able to produce a model. Theory behind the Flight model In this chapter the theory behind the flight model should be explained. The most information for our project we got out of a PDF (Oscar Mauricio Agudelo, 2014). Inertial frame and configuration In Figure 9 you can see the basic model of a quadcopter, like it was used in our project. Like you can see in this figure, the opposite rotors always have to turn in the same direction. The inertial frame was place in the middle of our quadcopter. The Yaw is the rotation around the z-axis with the angle ψ. The Pitch is the rotation around the y-axis with the angle θ. The Roll is the rotation around the x-axis with the angle φ. The first decision we had to make, was if we are flying in the X- or in the plus - configuration. The plus - configuration was chosen, because of simplification reasons. In the picture above, the plus - configuration is already taken. There you can see, that if you want to make a rotation around the x – axis, just two rotors have an impact. If you would take the X- configuration, there would be a control of all four rotors necessary for a rotation around one axis. Production of the equations for the model The first equations, which are made for the kinematic model, are the translational motion in the inertial frame. These equations can be set up as: In the equation above x, y and z are the position of the quadcopter. The term m·g is the inertial force, which pushes the quadcopter down to the ground. is the thrust vector which acts in the body frame, and R is the rotation matrix. is the drag force, caused by the air friction. The rotation matrix is defined as following: The size of the drag force is depending on the velocity in each direction, with the friction coefficient kd☁: The thrust fi from the i-th rotor is calculated by the propeller lift coefficient k and ω1 is the angular velocity☁: The sum of all thrust of the four motors is the total thrust☁: In the paper we had, they assumed, that the dynamics of the motor are much faster than those of our quadcopter, therefore we did not take them into our calculations in the kinematic model of the whole model☁. The angular velocity of each motor is proportional to the input voltage in the following equation. In this equation cm is constant, and vi is the input voltage applied to the motors☁: For the rotational equations of our quadcopter, we use the Euler’s equations of rigid body dynamics☁: In the above equation, Ι represents the inertia matrix of the quadcopter. The ω stands for the angular velocity actor and the τ stands for the external Torque vector.☁ The inertia matrix is defined as followed: After computing the cross product, the Euler's equations reduces to: The roll torque (τΦ) and the pitch torque (τθ) are derived from standard mechanics and where L represents the distance between the rotor and the quadcopter center point: All four rotor-torques act on the z-axis. The first task of them is to overcome the gravity force. The total torque around the z-axis is the yaw, which is called τψ with the propeller drag coefficient b☁: The roll, yaw and pitch are related to the components of the angular velocity vector with the projection matrix: With these few simple equations, we can write down the whole set of equations for our model: